/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.admin.service;

import org.springblade.modules.admin.dto.MaintainPlanAffairDTO;
import org.springblade.modules.admin.entity.MaintainPlanAffair;
import org.springblade.modules.admin.vo.MaintainPlanAffairVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.admin.vo.plan.AffairListVo;
import org.springblade.modules.admin.vo.plan.AffairStatusVo;
import org.springblade.modules.admin.vo.plan.MaintainPlanAffairDetailVO;
import org.springblade.modules.admin.vo.user.UserAffairAndCheckVo;

import java.util.List;

/**
 * 事务工单表 服务类
 *
 * @author ysq
 * @since 2023-11-10
 */
public interface IMaintainPlanAffairService extends BaseService<MaintainPlanAffair> {


	/**
	 * 新增一个事务工单
	 *
	 * @param maintainPlanAffair 参数
	 * @return 数据集
	 */
	Long add(MaintainPlanAffairVO maintainPlanAffair);

	/**
	 * 获取事务工单详情
	 *
	 * @param planId 工单id
	 * @return 数据集
	 */
	MaintainPlanAffairDetailVO detail(Long planId);

	IPage<AffairListVo> list(MaintainPlanAffairDTO maintainPlanAffairDTO);

	List<AffairListVo> list(MaintainPlanAffairDTO maintainPlanAffairDTO, Integer type);


	/**
	 * 获取工单的统计状态
	 *
	 * @return 数据集
	 */
	List<AffairStatusVo> getAffairStatus();


	/**
	 * 获取人员的待开始和进行中的工单
	 * 用于用户离职人员的校验
	 * @param userId 用户iD
	 * @return 数据集
	 */
	UserAffairAndCheckVo getPlanUserList(String userId);

	/**
	 * 获取执行人的工单
	 * 获取人员的待开始和进行中的工单
	 * 用于用户离职人员的校验
	 * @param userId 用户id
	 * @return 数据集
	 */
	List<AffairListVo> getPlanListOfUserId(String userId);
}
